#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include<string>
#include<iostream>
#define FIFO_FILE "mypipe"

int main()
{
    int fd = open(FIFO_FILE,O_WRONLY);

    while(true)
    {
    std::string message;
    getline(std::cin,message);
    write(fd,message.c_str(),sizeof message);
    }
    close(fd);
    return 0;
}